﻿using Hopscotch.Common.Contracts.EnqService;
using SignalR = Microsoft.AspNet.SignalR.Client;

namespace Hopscotch.Presentation.Communication.Util
{   
    internal static class ConnectionStateMapper
    {
        internal static ConnectionState Convert(SignalR.ConnectionState connectionState)
        {
            switch (connectionState)
            {
                case SignalR.ConnectionState.Connecting:
                    return ConnectionState.Connecting;
                case SignalR.ConnectionState.Connected:
                    return ConnectionState.Connected;
                case SignalR.ConnectionState.Reconnecting:
                    return ConnectionState.Reconnecting;
                case SignalR.ConnectionState.Disconnected:
                    return ConnectionState.Disconnected;
                default:
                    return ConnectionState.Unknown;
            }
        }
    }

}
